home *** CD-ROM | disk | FTP | other *** search
/ Mac Easy 2010 May / Mac Life Ubuntu.iso / casper / filesystem.squashfs / var / lib / dpkg / info / ttf-opensymbol.postrm < prev    next >
Encoding:
Text File  |  2009-09-30  |  3.0 KB  |  110 lines

  1. #!/bin/sh
  2. # postrm script for ttf-opensymbol
  3.  
  4. THIS_PACKAGE=ttf-opensymbol
  5. THIS_SCRIPT=postrm
  6.  
  7. set -e
  8.  
  9. LIBSUFFIX=li
  10. PLATFORMID=linux_x86
  11.  
  12. # vim:set ai et sts=2 sw=2 tw=0:
  13.  
  14. # Query the terminal to establish a default number of columns to use for
  15. # displaying messages to the user.  This is used only as a fallback in the
  16. # event the COLUMNS variable is not set.  ($COLUMNS can react to SIGWINCH while
  17. # the script is running, and this cannot, only being calculated once.)
  18. DEFCOLUMNS=$(stty size 2> /dev/null | awk '{print $2}') || true
  19. if ! expr "$DEFCOLUMNS" : "[[:digit:]]\+$" > /dev/null 2>&1; then
  20.   DEFCOLUMNS=80
  21. fi
  22.  
  23. message() {
  24.     echo "$*" | fmt -t -w ${COLUMNS:-$DEFCOLUMNS} >&2
  25. }
  26.  
  27. # Prepare to move a conffile without triggering a dpkg question
  28. prep_rm_conffile() {
  29.     CONFFILE="$1"
  30.  
  31.     if [ -e "$CONFFILE" ]; then
  32.         md5sum="`md5sum \"$CONFFILE\" | sed -e \"s/ .*//\"`"
  33.         old_md5sum="`dpkg-query -W -f='${Conffiles}' $2 | grep $CONFFILE | awk '{print $2}'`"
  34.         if [ "$md5sum" = "$old_md5sum" ]; then
  35.             mv "$CONFFILE" "$CONFFILE.${THIS_PACKAGE}-tmp"
  36.         fi
  37.     fi
  38. }
  39.  
  40. rm_conffile_commit() {
  41.   CONFFILE="$1"
  42.  
  43.   if [ -e $CONFFILE.${THIS_PACKAGE}-tmp ]; then
  44.     rm $CONFFILE.${THIS_PACKAGE}-tmp
  45.   fi
  46. }
  47.  
  48. # Remove a no-longer used conffile
  49. rm_conffile() {
  50.     CONFFILE="$1"
  51.  
  52.     if [ -e "$CONFFILE" ]; then
  53.         md5sum="`md5sum \"$CONFFILE\" | sed -e \"s/ .*//\"`"
  54.         old_md5sum="`dpkg-query -W -f='${Conffiles}' $2 | grep $CONFFILE | awk '{print $2}'`"
  55.         if [ "$md5sum" != "$old_md5sum" ]; then
  56.             echo "Obsolete conffile $CONFFILE has been modified by you."
  57.             echo "Saving as $CONFFILE.dpkg-bak ..."
  58.             mv -f "$CONFFILE" "$CONFFILE".bak
  59.         else
  60.             echo "Removing obsolete conffile $CONFFILE ..."
  61.             rm -f "$CONFFILE"
  62.         fi
  63.     fi
  64. }
  65.  
  66. flush_unopkg_cache() {
  67.     /usr/lib/openoffice/program/unopkg list --shared > /dev/null 2>&1
  68. }
  69.  
  70. remove_extension() {
  71.   if /usr/lib/openoffice/program/unopkg list --shared $1 >/dev/null; then
  72.     echo -n "Removing extension $1..."
  73.     INSTDIR=`mktemp -d`
  74.     /usr/lib/openoffice/program/unopkg remove --shared $1 \
  75.       "-env:UserInstallation=file://$INSTDIR" \
  76.       '-env:UNO_JAVA_JFW_INSTALL_DATA=$OOO_BASE_DIR/share/config/javasettingsunopkginstall.xml' \
  77.       "-env:JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY=1"
  78.     if [ -n $INSTDIR ]; then rm -rf $INSTDIR; fi
  79.     echo " done."
  80.     flush_unopkg_cache
  81.   fi
  82. }
  83.  
  84. add_extension() {
  85.   echo -n "Adding extension $1..."
  86.   INSTDIR=`mktemp -d`
  87.   /usr/lib/openoffice/program/unopkg add --shared $1 \
  88.     "-env:UserInstallation=file:///$INSTDIR" \
  89.     '-env:UNO_JAVA_JFW_INSTALL_DATA=$OOO_BASE_DIR/share/config/javasettingsunopkginstall.xml' \
  90.     "-env:JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY=1"
  91.   if [ -n $INSTDIR ]; then rm -rf $INSTDIR; fi
  92.   echo " done."
  93. }
  94.  
  95. VER=
  96.  
  97.  
  98. if [ "$1" = "remove" ] && [ -x /usr/bin/fc-cache ]; then
  99.     echo "Updating fontconfig cache..."
  100.     fc-cache -fs
  101. fi
  102.  
  103. if [ "$1" = "purge" ]; then
  104.     rm -f /usr/share/fonts/truetype/openoffice/fonts.cache*
  105. fi
  106.  
  107.  
  108.  
  109. exit 0
  110.